package com.technology.education.ui.common.bind_wx

import android.os.Bundle
import com.technology.education.R
import com.technology.education.databinding.FragmentBindWxBinding
import com.technology.education.ext.getAppViewModel
import com.technology.education.ext.navigation
import me.hgj.jetpackmvvm.base.fragment.BaseVmDbFragment

/**
 * 验证手机号码,用于修改当前绑定手机号
 */
class BindWxFragment : BaseVmDbFragment<BindWxViewModel, FragmentBindWxBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.vm = mViewModel
        mViewModel.account.set(getAppViewModel().userInfo.value?.mobile)
    }

    override fun createObserver() {
        mViewModel.result.observe(this) {
            if (it) {
                navigation(requireView(), R.id.action_bindWxFragment_to_modifyPhoneFragment)
            }
        }
    }

    override fun showLoading(message: String) {
    }

    override fun dismissLoading() {
    }
}